import http from '@/plugins/aixos'

export function findAllWire(args: Record<string, any>) {
  const url =
    '/wire?' +
    Object.entries(args)
      .map(([key, value]) => `${key}=${value}`)
      .join('&')
  return http.request<WireModel[]>({
    url,
    method: 'GET',
  })
}

export function addManyWire(data: WireModel[]) {
  return http.request<WireModel[]>({
    url: '/wire/many',
    method: 'POST',
    data,
  })
}

export function delWire(id: number) {
  return http.request<WireModel>({
    url: `/wire/${id}`,
    method: 'DELETE',
  })
}
